<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            overflow: hidden;
        }
        img{
            /*行内元素对其方式:top,middle,bottom,baseline(基线对其)*/
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <input type="text"><img src="../b.jpg" width="100" alt="">
    <div>
        <img src="../b.jpg" alt="">
    </div>
</body>
</html>